package com.six.pojo.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@ApiModel("管理员信息")
public class AdminDto {
    @ApiModelProperty("id")
    private Long id;
    @ApiModelProperty("姓名")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{2,}$",message = "姓名必须为汉字")
    private String name;
    @ApiModelProperty("用户名")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{2,}$",message = "用户名不合法")
    private String username;
    @ApiModelProperty("密码")
    @Pattern(regexp = "^[A-Za-z0-9]{6,20}$",message = "密码不合法")
    private String password;
    @ApiModelProperty("确认密码")
    @Pattern(regexp = "^[A-Za-z0-9]{6,20}$",message = "密码不合法")
    private String confirmPassword;

    @ApiModelProperty("角色名")
    private String rname;

    private String roleIds;

    @ApiModelProperty("邮箱")
    @Email(message = "邮箱格式不对")
    private String email;
    @ApiModelProperty("电话")
    @Pattern(regexp = "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$",message = "手机不合法")
    private String phone;
    @ApiModelProperty("头像")
    @NotBlank
    private String image;

    private String perms;
}
